z65 - A Z-machine v3 interpreter for CP/M-65#263
Merged
davidgiven merged 37 commits intodavidgiven:masterfrom Jan 24, 2026
Merged
z65 - A Z-machine v3 interpreter for CP/M-65#263davidgiven merged 37 commits intodavidgiven:masterfrom
davidgiven merged 37 commits intodavidgiven:masterfrom
Conversation
… to be modified to support larger addresses
…zork now mostly runs
… after restore for unknown reason
Owner
|
Very nice! (I do have prior Z-machine art; my game Changes came fourth in the annual Interactive Fiction competation in... 2004? But it was a Z5, and used every single byte of low memory, so I doubt it would work on CP/M-65 anyway.) Merging. |
Contributor
Author
|
Interesting! Maybe it is possible to get basic Z5 running, if you don't use the split screen functionality etc. but the amount of available dynamic memory would be less than with only Z3 for sure. |
Owner
|
...on second thoughts, that game is written in I7 meaning it's not the quickest, and it also contains a fairly complicated ecosystem simulation and I did get comments that it's pretty sluggish even on new systems. I hate to think what it would be like on a 1MHz 6502. Anyway, this is really cool! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As no computer should be without Zork, I wrote a a Z-machine interpreter for CP/M-65. It only supports v3 games, which seems to be the version used by most classic games and I wanted to avoid all the exceptions for v1 and v2, and supporting the newer version doesn't really make sense on limited hardware.
In order to run with as little TPA as possible (even though the binary is quite large...) I use a simple system with cached pages to load the needed static parts from disk as they are accessed. For the dynamic RAM, zmalloc is used to allocate it when the game header is loaded, so it should (hopefully) fail gracefully if it doesn't fit in the available memory.
The status bar is not implemented currently as the binary was getting large enough without it. I may try to implement this later and only show it if the screen driver is available.
Saving/restoring games is supported if the games implement it. There is no check if the restored file is for the correct game, so there is some potential for interesting crashes there.
I have tested it with Zork I-III, Mini-Zork, Planetfall, Hollywood Hijinx etc. and it all seems to work fine (although I'm sure there are still a lot of bugs hiding in there...).
z65 itself + the freeware 10k adventure Moonglow has been added to all platforms where it fits on the disk (i.e. all except BBC Micro, all Commodores, some Ataris, some OSI).
I put the code under third_party as this was like a small project of its own to write.
Below are some screenshots:
Zork I running on the Atari 800

Mini-Zork running on the Oric

Moonglow running on the Apple II

Moonglow running on the BBC Micro

Moonglow running on the C64

Moonglow running on the OSI600
